import React from "react";
import InputWithLabel from "./InputWithLabel";
import styles from './test.module.css';

const SearchForm = ({ searchTerm, onSearch, onSearchSubmit }) => (
  <form onsubmit={onSearchSubmit} className={styles.search_form}>
    <InputWithLabel
      id="search"
      value={searchTerm}
      onInputChange={onSearch}
      isFocused
    >
      <strong>Search:</strong>
    </InputWithLabel>

    <button disabled={!searchTerm} type="submit" className={styles.btn}>
      Submit
    </button>
  </form>
);

export default SearchForm;
